#!/usr/bin/env python3

from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration


def generate_launch_description():
    """启动简单z轴速度控制器"""
    
    return LaunchDescription([
        # 声明参数
        DeclareLaunchArgument(
            'z_velocity',
            default_value='0.2',
            description='固定z轴速度 (m/s)'
        ),
        
        DeclareLaunchArgument(
            'altitude_tolerance',
            default_value='0.05',
            description='高度到达容差 (m)'
        ),
        
        # 简单z轴速度控制器
        Node(
            package='pb2025_sentry_nav',
            executable='simple_z_velocity_controller.py',
            name='simple_z_velocity_controller',
            output='screen',
            parameters=[{
                'z_velocity': LaunchConfiguration('z_velocity'),
                'altitude_tolerance': LaunchConfiguration('altitude_tolerance'),
            }]
        ),
    ]) 